package com.labor_management_system.Entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

/**
 * 
 * @TableName team
 */
@TableName(value ="team")
@Data
//班组
public class Team implements Serializable {
    /**
     * 
     */
    @TableId
    @JsonProperty("teamId")
    private String teamId;

    @JsonProperty("teamName")
    private String teamName;

    @JsonProperty("contractor")
    private String contractor;

    @JsonProperty("trades")
    private Integer trades;

    @JsonProperty("contractorPhone")
    private String contractorPhone;

    @JsonProperty("enterprisesName")
    private String enterprisesName;
    @JsonProperty("teamSize")
    private Integer teamSize;//默认0,进一个人改一次

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    private Integer volumeUpSize;

    public Team(String toString, String name, String scontractor, int tsrades, String contractorPhones, String enterprisesNamex, int teamSizes) {
        setTeamName(name);setTeamId(toString);setTeamSize(teamSizes);setContractor(scontractor);setTrades(tsrades);setContractorPhone(contractorPhones);
        setEnterprisesName(enterprisesNamex);
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Team other = (Team) that;
        return (this.getTeamId() == null ? other.getTeamId() == null : this.getTeamId().equals(other.getTeamId()))
            && (this.getTeamName() == null ? other.getTeamName() == null : this.getTeamName().equals(other.getTeamName()))
            && (this.getContractor() == null ? other.getContractor() == null : this.getContractor().equals(other.getContractor()))
            && (this.getTrades() == null ? other.getTrades() == null : this.getTrades().equals(other.getTrades()))
            && (this.getContractorPhone() == null ? other.getContractorPhone() == null : this.getContractorPhone().equals(other.getContractorPhone()))
            && (this.getEnterprisesName() == null ? other.getEnterprisesName() == null : this.getEnterprisesName().equals(other.getEnterprisesName()))
            && (this.getTeamSize() == null ? other.getTeamSize() == null : this.getTeamSize().equals(other.getTeamSize()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTeamId() == null) ? 0 : getTeamId().hashCode());
        result = prime * result + ((getTeamName() == null) ? 0 : getTeamName().hashCode());
        result = prime * result + ((getContractor() == null) ? 0 : getContractor().hashCode());
        result = prime * result + ((getTrades() == null) ? 0 : getTrades().hashCode());
        result = prime * result + ((getContractorPhone() == null) ? 0 : getContractorPhone().hashCode());
        result = prime * result + ((getEnterprisesName() == null) ? 0 : getEnterprisesName().hashCode());
        result = prime * result + ((getTeamSize() == null) ? 0 : getTeamSize().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", teamId=").append(teamId);
        sb.append(", teamName=").append(teamName);
        sb.append(", contractor=").append(contractor);
        sb.append(", trades=").append(trades);
        sb.append(", contractorPhone=").append(contractorPhone);
        sb.append(", enterprisesName=").append(enterprisesName);
        sb.append(", teamSize=").append(teamSize);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}